<template>
  <div id="main"></div>
</template>
<script>
export default {
    props:['option','type'],
  data() {
    return {};
  },
  mounted() {
    var chartDom = document.getElementById("main");
    var myChart = this.$echarts.init(chartDom);
    var option;

    option = {
      xAxis: {
        type: "category",
        data: this.option.xAxis,
      },
      yAxis: {
        type: "value",
      },
      series: [
        {
          data: this.option.series,
          type: this.type,
        },
      ],
    };
    option && myChart.setOption(option);
  },
};
</script>
<style lang="scss" scoped>
</style>
